GtkSeparatorToolItem: Remove priv pointer
authorTimm Bäder <mail@baedert.org>
Sat, 7 Jul 2018 16:30:29 +0000 (18:30 +0200)
committerTimm Bäder <mail@baedert.org>
Sun, 8 Jul 2018 07:41:15 +0000 (09:41 +0200)
gtk/gtkseparatortoolitem.c
gtk/gtkseparatortoolitem.h

index 7964f5e8e23ba929aff6127bc4f1d00aab2859e8..a557adb2b69c9c8088771cd836e7aa1f43d0ba33 100644 (file)
 
 #define MENU_ID "gtk-separator-tool-item-menu-id"
 
-struct _GtkSeparatorToolItemPrivate
+typedef struct
 {
   guint draw : 1;
-};
+} GtkSeparatorToolItemPrivate;
 
 enum {
   PROP_0,
@@ -107,11 +107,10 @@ gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass *class)
 static void
 gtk_separator_tool_item_init (GtkSeparatorToolItem *separator_item)
 {
-  GtkSeparatorToolItemPrivate *priv;
+  GtkSeparatorToolItemPrivate *priv = gtk_separator_tool_item_get_instance_private (separator_item);
   GtkWidget *widget;
 
   widget = GTK_WIDGET (separator_item);
-  priv = separator_item->priv = gtk_separator_tool_item_get_instance_private (separator_item);
   priv->draw = TRUE;
 
   gtk_widget_set_has_surface (widget, FALSE);
@@ -204,9 +203,11 @@ gtk_separator_tool_item_new (void)
 gboolean
 gtk_separator_tool_item_get_draw (GtkSeparatorToolItem *item)
 {
+  GtkSeparatorToolItemPrivate *priv = gtk_separator_tool_item_get_instance_private (item);
+
   g_return_val_if_fail (GTK_IS_SEPARATOR_TOOL_ITEM (item), FALSE);
-  
-  return item->priv->draw;
+
+  return priv->draw;
 }
 
 /**
@@ -222,13 +223,15 @@ void
 gtk_separator_tool_item_set_draw (GtkSeparatorToolItem *item,
                                   gboolean              draw)
 {
+  GtkSeparatorToolItemPrivate *priv = gtk_separator_tool_item_get_instance_private (item);
+
   g_return_if_fail (GTK_IS_SEPARATOR_TOOL_ITEM (item));
 
   draw = draw != FALSE;
 
-  if (draw != item->priv->draw)
+  if (draw != priv->draw)
     {
-      item->priv->draw = draw;
+      priv->draw = draw;
       if (draw)
         gtk_style_context_remove_class (gtk_widget_get_style_context (GTK_WIDGET (item)),
                                         "invisible");
index 2fff9e4fcd592b299d9bf18fdf2b519cb029a1f5..2d0eac535dac81d05a667c3d710308bda4bb702c 100644 (file)
@@ -37,14 +37,10 @@ G_BEGIN_DECLS
 
 typedef struct _GtkSeparatorToolItem        GtkSeparatorToolItem;
 typedef struct _GtkSeparatorToolItemClass   GtkSeparatorToolItemClass;
-typedef struct _GtkSeparatorToolItemPrivate GtkSeparatorToolItemPrivate;
 
 struct _GtkSeparatorToolItem
 {
-  GtkToolItem parent;
-
-  /*< private >*/
-  GtkSeparatorToolItemPrivate *priv;
+  GtkToolItem parent_instance;
 };
 
 /**